Invalid regular expression specified

Hi All,

I found a strange behaviour regarding regular expression.

I want to create a very simple filter on a column content with regular expression for objects with values in this column

Here is my regular expression :

^.*

As a result, I have the following message : "Invalid regular expression specified" and nothing happens !!

This error occurs only on some module whereas they all contains same format of values in that column !!!

Samples of values :
R@CCF_G2#EGN-S-01400,EGN-S-01410
T@CCF_G2@F_S/S#EGN-S-01400

There is no regexp reserved word in my column

Any idea on that issue

Thanks and regards
SystemAdmin - Fri Mar 16 06:40:22 EDT 2012

Re: Invalid regular expression specified
Peter_Albert - Fri Mar 16 06:53:39 EDT 2012

I don't know why your regular expression sometinmes fails, but I am using the slightly simpler version

.+

successfully on layout DXL columns.

Regards,

Peter

Re: Invalid regular expression specified
SystemAdmin - Fri Mar 16 06:59:03 EDT 2012

Peter_Albert - Fri Mar 16 06:53:39 EDT 2012
I don't know why your regular expression sometinmes fails, but I am using the slightly simpler version

.+

successfully on layout DXL columns.

Regards,

Peter

:-) which can be reduced even more to

.


:-)

Re: Invalid regular expression specified
SystemAdmin - Fri Mar 16 07:01:56 EDT 2012

I am also not sure in which circumstances this fails, but the * in

^.*

 


means: "does begin with zero or more characters of something" - which is probably not what you wanted to say

 

Re: Invalid regular expression specified
SystemAdmin - Fri Mar 16 09:00:41 EDT 2012

SystemAdmin - Fri Mar 16 07:01:56 EDT 2012

I am also not sure in which circumstances this fails, but the * in

^.*

 


means: "does begin with zero or more characters of something" - which is probably not what you wanted to say

 

Thanks for your replies and suggessions but I tried all of them and none is working !!!

Re: Invalid regular expression specified
SystemAdmin - Fri Mar 16 10:12:22 EDT 2012

SystemAdmin - Fri Mar 16 09:00:41 EDT 2012
Thanks for your replies and suggessions but I tried all of them and none is working !!!

I assume, you are not using the dialog Tools->Filter->Define->Columns, but DXL to create the filter.

Perhaps you can post some code?

Re: Invalid regular expression specified
PDU - Fri Mar 16 12:42:01 EDT 2012

Hi,

to do a filter 'not empty' on a column, i use
^*$

i don't try inside DXL script

Pierre

Re: Invalid regular expression specified
llandale - Fri Mar 16 12:53:02 EDT 2012

This works:
Regexp re = regexp2("^.*")

But I think it means "match a string that has zero or more characters at the front", which is any string. I think you may want this:

Regexp re = regexp2("^.+")
Meaning one or more characters.

Or just check for null:
string Text = get the text of the column
if (null Text) then its empty else there is something there

-Louie

Re: Invalid regular expression specified
SystemAdmin - Fri Mar 16 12:55:00 EDT 2012

PDU - Fri Mar 16 12:42:01 EDT 2012
Hi,

to do a filter 'not empty' on a column, i use
^*$

i don't try inside DXL script

Pierre

^ does not mean "not" but it means "beginning of string"

So the regexp

^.*

Is quite strange because it will match any string where there is 0 or more characters after the beginning, so it will match all possible strings. In other words such a regexp is completely useless, and that may be the reason why Doors is barking at you.

Vincent.

Re: Invalid regular expression specified
llandale - Fri Mar 16 14:51:26 EDT 2012

SystemAdmin - Fri Mar 16 12:55:00 EDT 2012
^ does not mean "not" but it means "beginning of string"

So the regexp

^.*

Is quite strange because it will match any string where there is 0 or more characters after the beginning, so it will match all possible strings. In other words such a regexp is completely useless, and that may be the reason why Doors is barking at you.

Vincent.

^ means "beginning of string" when its the first character of the regexp. Otherwise it does mean not. I think you can put it in braces if you want "not" as the first thing;
^.*

-Louie

Re: Invalid regular expression specified
SystemAdmin - Sat Mar 17 05:33:21 EDT 2012

PDU - Fri Mar 16 12:42:01 EDT 2012
Hi,

to do a filter 'not empty' on a column, i use
^*$

i don't try inside DXL script

Pierre

Just to summarize:
As you say that you do not use DXL, so you just use the dialog, click on "Columns", click on one column, enter a "." in the field "Contains", click on "Regular Expression" and "Apply"

And then DOORS complains "Invalid regular expression...".

Still that sounds strange to me.

Can you check that you did not enter any spaces or other things in front of or behind the "."?
Can you please attach a screen shot showing the column, the filter definitions and the error message?
I hope that the problem is someting obvious that we just didn't notice.

  • Mike